export const  chooseImage = (sourceType) => {
    return new Promise((resolve,reject) => {
        wx.chooseImage({
            count: 1,
            sourceType,
            sizeType: ['compressed'], // 官方压缩设置
            success: function(result) {
                const {tempFilePaths} = result;
                const path = tempFilePaths[0];
                wx.compressImage({
                    src: path, // 图片路径
                    quality: 80, // 压缩质量
                    compressedWidth: 600,
                    compressedHeight: 545,
                    success: res => {
                        resolve(res);
                    }
                });
            }
        });

    });
};   

export default {};